package com.zhx.basis;

public class 内存溢出 {
    public static void main(String[] args) {
        try {
            // 尝试分配大量内存
            int[] largeArray = new int[Integer.MAX_VALUE];
        } catch (OutOfMemoryError e) {
            System.out.println("发生了内存溢出错误");
            e.printStackTrace();
        }
        System.out.println("发生1错误");
    }
}
